package com.woniu.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@ApiModel(value = "新增维修员工表单", description = "新增维修员工表单")
public class InsertEmployeeForm {

    @ApiModelProperty("手机号")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    String phone;

    @ApiModelProperty("用户名")
    @Length(min = 1, max = 10, message = "用户名长度在1-10位之间")
    @NotNull(message = "用户名不能为空")
    String userName;

    @ApiModelProperty("密码")
    @Length(min = 1, max = 10, message = "密码长度在1-10位之间")
    @NotNull(message = "密码不能为空")
    String passWord;

    @ApiModelProperty("学号或工号")
    @Length(min = 8, max = 10, message = "学号或工号长度在8-10位之间")
    @NotNull(message = "学号或工号不能为空")
    String userCard;

    @ApiModelProperty("区域id")
    @Min(value = 1, message = "区域id必须为正整数")
    @NotNull(message = "区域id不能为空")
    Integer areaCodeId;

    @ApiModelProperty("专业")
    @Length(min = 1, max = 10, message = "专业长度在1-10位之间")
    @NotNull(message = "专业不能为空")
    String profession;
}
